﻿using ProtoBuf;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace McsUtility.Models
{
	public class ResultModel
	{
		public bool success { get; set; }
		public string message { get; set; }
		public object data { get; set; }
	}

	public class LoginModel
	{
		//注册时需获取验证码，此处只传LoginName
		public string LoginName { get; set; }
		public string LoginPass { get; set; }
		public string Name { get; set; }
		public string MacAddress { get; set; }
        public string Version { get; set; }

    }

	public class MinerClientLoginModel
	{
		public string LoginName { get; set; }
		public string LoginPass { get; set; }
		public string PoolUrl { get; set; }
		public string Wallet { get; set; }
	}
	public class RegModel
	{
		//注册需要获取验证码
		public string LoginName { get; set; }
		public string LoginPass { get; set; }
		public int SMSCode { get; set; }
		public string Name { get; set; }
		public int Sex { get; set; }
		public string CardID { get; set; }

		/// <summary>
		/// QQ号
		/// </summary>
		public string PassQuestion1 { get; set; }

		public string PassAnswer1 { get; set; }

		/// <summary>
		/// 微信
		/// </summary>
		public string PassQuestion2 { get; set; }
		public string PassAnswer2 { get; set; }

		/// <summary>
		/// 客户经理Id
		/// </summary>
		public string PassQuestion3 { get; set; }

		public string PassAnswer3 { get; set; }
	}
	public class WalletsModel
	{
		/// <summary>
		/// Id
		/// 获取钱包信息时，此项为钱包Id
		/// 添加钱包时，此项为币种Id
		/// </summary>
		public int ID { get; set; }
		public string Address { get; set; }
		public string Remark { get; set; }
	}
	public class RemarkModel
	{
		/// <summary>
		/// Id
		/// 获取钱包信息时，此项为钱包Id
		/// 添加钱包时，此项为币种Id
		/// </summary>
		public int ID { get; set; }
		public int MinerID { get; set; }
		public string Remark { get; set; }
	}
	public class CurrencysModel
	{
		public int ID { get; set; }
		public string Name { get; set; }
		public string Remark { get; set; }

		/// <summary>
		/// 币种类型
		/// 1 主挖
		/// 2 副挖
		/// </summary>
		public int Type { get; set; }
		public List<WalletsModel> Wallets { get; set; }
		public List<WalletsModel> OrePools { get; set; }
	}
	public class LoginResultModel
	{
		public int UserID { get; set; }
		public string Name { get; set; }
		public string Phone { get; set; }
		public int Sex { get; set; }
		public List<CurrencysModel> Currencys { get; set; }
        public StaffModel Staff { get; set; }

    }
	public class LoginResultForCommServerModel
	{
		public ClientType ClientType { get; set; }

		/// <summary>
		/// 连接NodeServer的Id
		/// </summary>
		public int connID { get; set; }

		/// <summary>
		/// 用户Id
		/// </summary>
		public int UserID { get; set; }

		/// <summary>
		/// 用户名
		/// </summary>
		public string Name { get; set; }

		/// <summary>
		/// 矿机Id
		/// </summary>
		public int MinerID { get; set; }

		/// <summary>
		/// 矿机名
		/// </summary>
		public string MinerName { get; set; }
	}
	[ProtoContract]
	public class MinersModel
	{
		[ProtoMember(1)]
		public int ID { get; set; }
		[ProtoMember(2)]
		public int UserID { get; set; }
		[ProtoMember(3)]
		public string MacAddress { get; set; }
		[ProtoMember(4)]
		public bool Second { get; set; }
		[ProtoMember(5)]
		public bool AutoName { get; set; }
		[ProtoMember(6)]
		public bool AutoRun { get; set; }
		[ProtoMember(7)]
		public bool AutoUpdate { get; set; }
		[ProtoMember(8)]
		public string MinerName { get; set; }

		/// <summary>
		/// 状态
		/// 0 不在线
		/// 1 在线
		/// 2 挖矿中
		/// </summary>
		[ProtoMember(9)]
		public int State { get; set; }

		[ProtoMember(10)]
		public DateTime StateTime { get; set; }
		[ProtoMember(11)]
		public string FirstCoin { get; set; }
		[ProtoMember(12)]
		public string SecondCoin { get; set; }
		[ProtoMember(13)]
		public string FirstPool { get; set; }
		[ProtoMember(14)]
		public string SecondPool { get; set; }
		[ProtoMember(15)]
		public string FirstWallet { get; set; }
		[ProtoMember(16)]
		public string SecondWallet { get; set; }
		[ProtoMember(17)]
		public string MinFan { get; set; }
		[ProtoMember(18)]
		public string MaxFan { get; set; }
		[ProtoMember(19)]
		public string Dcri { get; set; }
		[ProtoMember(20)]
		public string RedisData { get; set; }
		[ProtoMember(21)]
		public string AdvParams { get; set; }
		[ProtoMember(22)]
		public string BackupPool { get; set; }
        [ProtoMember(23)]
        public string MinTemp { get; set; }
        [ProtoMember(24)]
        public string MaxTemp { get; set; }
        [ProtoMember(25)]
        public string Eres { get; set; }//3G显卡支持
        [ProtoMember(26)]
        public string MinSpeed { get; set; }//最低算力预警
        [ProtoMember(27)]
        public HighTempStrategy HighTempStrategy { get; set; }//高温策略
        [ProtoMember(28)]
        public bool HighTempWarn { get; set; }//高温报警
        [ProtoMember(29)]
        public bool LowStrengthWarn { get; set; }//低算力报警
        [ProtoMember(30)]
        public CoreType CoreType { get; set; }//内核
        [ProtoMember(31)]
        public string Version { get; set; }//矿工版本



    }
    public enum HighTempStrategy 
    {
        /// <summary>
        /// 无操作
        /// </summary>
        NoOperation = 0,
        /// <summary>
        /// 降低强度
        /// </summary>
        ReduceStrength = 1,
    }
    public enum CoreType
    {
        Core98 = 1,
        Core114 = 2,
        Core115 = 3,
        Core116 = 4,
    }

    public class MinersRequestModel
	{
		/// <summary>
		/// 状态
		/// -1 全部
		/// 0 不在线
		/// 1 在线
		/// 2 挖矿中
		/// </summary>
		public int State { get; set; }
		/// <summary>
		/// 币种ID
		/// </summary>
		public string Currency { get; set; }
		/// <summary>
		/// 矿池地址
		/// </summary>
		public string OrePool { get; set; }
		/// <summary>
		/// 钱包地址
		/// </summary>
		public string Wallet { get; set; }
		/// <summary>
		/// 页码
		/// </summary>
		public int PageIndex { get; set; }
		/// <summary>
		/// 每页记录数
		/// </summary>
		public int PageRows { get; set; }
	}
	[ProtoContract]
	public class MinersResponseModel
	{
		[ProtoMember(1)]
		public int TotalRows { get; set; }
		[ProtoMember(2)]
		public List<MinersModel> Miners { get; set; }
        [ProtoMember(3)]
        public int Rows { get; set; }
        [ProtoMember(4)]
        public int OnLineRows { get; set; }
        [ProtoMember(5)]
        public int WarnRows { get; set; }
    }

    public class MinersMiningRequestModel
	{
		public List<int> MinersIDs { get; set; }
		public bool Second { get; set; }
		public bool AutoName { get; set; }
		public bool AutoRun { get; set; }
		public bool AutoUpdate { get; set; }
		public string MinerName { get; set; }
		public string FirstCoin { get; set; }
		public string SecondCoin { get; set; }
		public string FirstPool { get; set; }
		public string BackupPool { get; set; }
		public string SecondPool { get; set; }
		public string FirstWallet { get; set; }
		public string SecondWallet { get; set; }
		public string MinFan { get; set; }
		public string MaxFan { get; set; }
		public string MinTemp { get; set; }
		public string MaxTemp { get; set; }
		public string Dcri { get; set; }
        public string AdvParams { get; set; }
        public string Eres { get; set; }//3G显卡支持
        public string MinSpeed { get; set; }//最低算力预警
        public HighTempStrategy HighTempStrategy { get; set; }//高温策略
        public bool HighTempWarn { get; set; }//高温报警
        public bool LowStrengthWarn { get; set; }//低算力报警
        public CoreType CoreType { get; set; }//内核
    }
    public class MinerManagerModifyBatchModel
	{
		public List<int> MinersIDs { get; set; }
		public string FirstCoin { get; set; }
		public string SecondCoin { get; set; }
		public string FirstPool { get; set; }
		public string SecondPool { get; set; }
		public string FirstWallet { get; set; }
		public string SecondWallet { get; set; }
	}
	public class GetNodeServerResponseModel
	{
		/// <summary>
		/// 管理端连接NodeServerId
		/// </summary>
		public int ConnID { get; set; }

		public string IP { get; set; }
		public int Port { get; set; }
	}
	public class RedisDataModel
	{
		public int MinerID { get; set; }
		public string RedisData { get; set; }
	}
	public class MinerCloseModel
	{
		public int connID { get; set; }
		public int MinerID { get; set; }
		public string MinerName { get; set; }
		public int UserID { get; set; }
	}

	public class MinerClientStatusModel
	{
		public int ConnId { get; set; }
		public int MinerId { get; set; }
		public string MinerName { get; set; }
		public MinersModel Model { get; set; }
	}
    public class MinerWalletModel
    {
        public int MinerID { get; set; }
        public int UserID { get; set; }
        public string MinerName { get; set; }
        public string UserName { get; set; }
        public string UserPhone { get; set; }
        public string WalletAddress { get; set; }
    }
    public class WarnModel
    {
        public int ConnID { get; set; }

		/// <summary>
		/// 报警类别
		/// 0 高温
		/// 1 低算力
		/// </summary>
        public int WarnType { get; set; }

        public string WarnMessage { get; set; }
        public int UserID { get; set; }
        public int MinerID { get; set; }
        public string MinerName { get; set; }

    }
    public class MinerLogsRequestModel
    {
        public int MinerID { get; set; }
        public int PageIndex { get; set; }
        public int PageRows { get; set; }
    }
    public class MinerLogsModel
    {
        public DateTime CreateTime { get; set; }
        public string Logs { get; set; }
    }
    public class MinerLogsResponseModel
    {
        public int TotalRows { get; set; }
        public List<MinerLogsModel> Logs { get; set; }
    }
    public class StaffModel
    {
        public int ID { get; set; }
        public string Name { get; set; }
        public string QQ1 { get; set; }
        public string QQ2 { get; set; }
        public string QQ3 { get; set; }
        public string WeiXin1 { get; set; }
        public string WeiXin2 { get; set; }
        public string WeiXin3 { get; set; }
        public StaffModel()
        {
            ID = 0;
            Name = "";
            QQ1 = "";
            QQ2 = "";
            QQ3 = "";
            WeiXin1 = "";
            WeiXin2 = "";
            WeiXin3 = "";
        }
    }

    public class MinerHashrate
    {
        /// <summary>
        /// 主币信息（算力，接受数，拒绝数）
        /// </summary>
        public string Ta { get; set; }
        public string Tb { get; set; }

        /// <summary>
        /// 显卡主币算力信息
        /// </summary>
        public string Sa { get; set; }
        public string Sb { get; set; }

        /// <summary>
        /// 显卡温度及风扇转速（显卡1温度;显卡1风扇;显卡2温度...）
        /// </summary>
        public string TmpFan { get; set; }
    }

}